package com.shaungti;

import java.util.Scanner;

public class One {
    public static void main(String[] args) {
        //第一题：分别输入年月日，判断这一天是这一年的第几天（switch+for）
        Scanner sc = new Scanner(System.in);
        System.out.println("输入你想判断的年");
        int year = sc.nextInt();
        System.out.println("输入你想判断的月");
        int month = sc.nextInt();
        System.out.println("输入你想判断的日");
        int day = sc.nextInt();

        int zong=0;
        for(int i=1;i<month;i++){//i代表月份
            switch (i) {
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    zong=zong+31;
                    break;
                case 4:
                case 6:
                case 9:
                case 11:
                    zong=zong+30;
                    break;
                case 2:
                    if(year%4==0 && year%100!=0 || year%400==0){
                        zong=zong+29;
                    }
                    else {
                        zong=zong+28;
                    }
                    break;
        }

        } zong=zong+day;
        System.out.println("这一天是这一年的第"+zong+"天");
    }
}
